package mp

import (
	"duoke/service"
	"duoke/utils/gconv"
	"duoke/utils/request"
	"duoke/utils/response"
	"github.com/gin-gonic/gin"
)

var CourseMenu = new(courseMenuCtl)

type courseMenuCtl struct{}

func (ctl *courseMenuCtl) List(c *gin.Context) {
	req := request.JsonMap(c)
	id := gconv.Int(req["id"])
	list, err := service.CourseMenu.List(c, id)
	if err != nil {
		response.Error(c, err.Error(), nil)
		return
	}
	response.Success(c, "success", list)
}
